<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataTable id="userListTable" var="user" value="#{userModel.list}"
		filteredValue="#{userModel.filteredList}" filterEvent="enter"
		rowKey="#{user.id}" selection="#{shoppingCartModel.customer}"
		selectionMode="single" paginator="true" rows="10"
		rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
		<p:ajax event="rowSelect" update=":detailForm,:headerForm"
			listener="#{userController.onRowSelect}"></p:ajax>
		<p:column headerText="id">
		<f:facet name="header">
				<p:commandButton ajax="true" update="userListTable,:detailForm"
					actionListener="#{userController.initWithoutCheck}"
					value="Reload" style=" font-size:0.9em;float:left"></p:commandButton>
			</f:facet>
			<h:outputText value="#{user.id}" />
		</p:column>
		<p:column sortBy="#{user.lastName}" filterBy="#{user.lastName}"
			filterMatchMode="contains">
			<h:outputText value="#{user.lastName}" />
		</p:column>
		<p:column sortBy="#{user.firstName}" filterBy="#{user.firstName}"
			filterMatchMode="contains">
			<h:outputText value="#{user.firstName}" />
		</p:column>
		<p:column sortBy="#{user.dropOffLocation.number}"
			filterBy="#{user.dropOffLocation.number}:#{user.dropOffLocation.address}"
			filterMatchMode="contains">
			<h:outputText
				value="#{user.dropOffLocation.number}:#{user.dropOffLocation.address}" />
		</p:column>
		<p:column headerText="Bal." sortBy="#{user.balance}">
			<h:outputText value="#{user.balance}">
				<f:convertNumber type="currency" currencySymbol="$"
					minFractionDigits="2" maxFractionDigits="2"></f:convertNumber>
			</h:outputText>
		</p:column>
		<p:column sortBy="#{user.email}" filterBy="#{user.email}"
			filterMatchMode="contains">
			<h:outputText value="#{user.email}" />
		</p:column>
		<p:column sortBy="#{user.telephone}" filterBy="#{user.telephone}"
			filterMatchMode="contains">
			<h:outputText value="#{user.telephone}" />
		</p:column>
		<p:column headerText="Created Date" sortBy="#{user.createdDate}">
			<h:outputText value="#{user.createdDate}" />
		</p:column>
		<p:column headerText="Act." sortBy="#{user.isActivated}">
			<p:selectBooleanCheckbox value="#{user.isActivated}" disabled="true"></p:selectBooleanCheckbox>
		</p:column>
		<p:column headerText="memo" filterBy="#{user.memo}"
			filterMatchMode="contains" width="50">

		</p:column>
	</p:dataTable>
</ui:composition>
</html>